package com.whfc.emp.enums;

import java.util.Arrays;

/**
 * @ClasssName WoFaceGateCode
 * @Description wo平台返回码
 * @Author hw
 * @Date 2021/2/20 10:56
 * @Version 1.0
 */
public enum WoFaceGateCode {

    GS_EXP_1302("GS_EXP-1302", "人像侧角度大于15度"),
    GS_EXP_1303("GS_EXP-1303", "照片中无人像或不止一张人像"),
    GS_EXP_1304("GS_EXP-1304", "上传图片过大"),
    GS_EXP_1305("GS_EXP-1305", "base64可能未上传或图片过大"),
    GS_EXP_1306("GS_EXP-1306", "检测异常"),
    GS_EXP_3012("GS_EXP-3012", "照片中存在多个人像"),
    GS_EXP_3013("GS_EXP-3013", "人像侧脸角度过大"),
    OP_EXP_502("OP_EXP-502", "没有人像"),
    OP_EXP_2002("OP_EXP-2002", "图片没有检测到人像"),
    OP_EXP_2006("OP_EXP-2006", "图片人像数量过多"),
    OP_EXP_3000("OP_EXP-3000", "人像太小"),
    OP_EXP_3001("OP_EXP-3001", "人像超出或过于靠近图片边界"),
    OP_EXP_3002("OP_EXP-3002", "脸过于模糊"),
    OP_EXP_3003("OP_EXP-3003", "脸光照过暗"),
    OP_EXP_3004("OP_EXP-3004", "脸光照过亮"),
    OP_EXP_3005("OP_EXP-3005", "脸左右亮度不对称"),
    OP_EXP_3006("OP_EXP-3006", "三维旋转之俯仰角度过大"),
    OP_EXP_3007("OP_EXP-3007", "三维旋转之左右旋转角过大"),
    OP_EXP_3008("OP_EXP-3008", "平面内旋转角过大"),
    OP_EXP_3009("OP_EXP-3009", "添加照片请求过于频繁"),
    OP_EXP_3010("OP_EXP-3010", "图片下载失败"),
    PP_EXP_3001("PP_EXP-3001", "人员未添加照片"),
    PP_EXP_3004("PP_EXP-3004", "超过人像数量限制"),
    PP_EXP_3006("PP_EXP-3006", "人员已授权"),
    PP_EXP_3009("PP_EXP-3009", "有人未添加照片"),
    PP_EXP_3013("PP_EXP-3013", "人像的角度过大"),
    PP_EXP_3014("PP_EXP-3014", "人像太小，至少占图片面积的20%"),
    PP_EXP_3022("PP_EXP-3022", "照片亮度过暗或过亮"),
    PP_EXP_3023("PP_EXP-3023", "照片模糊"),
    PP_EXP_3024("PP_EXP-3022", "照片中人像两侧光线不对称"),
    PP_EXP_3025("PP_EXP-3025", "人像不全在照片内"),
    PP_EXP_3029("PP_EXP-3029", "照片相似度过低");
    private String value;

    private String desc;

    WoFaceGateCode(String value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static String parseByValue(String value) {
        for (WoFaceGateCode woFaceGateCode : WoFaceGateCode.values()) {
            if (value.equals(woFaceGateCode.getValue())) {
                return woFaceGateCode.getDesc();
            }
        }
        return null;
    }
}
